TARGET = libxnl.so

XNL_ROOT = ..

INCLUDES += \

SOURCES = \
$(XNL_ROOT)/src/base/Object.cpp \
$(XNL_ROOT)/src/base/AutoreleasePool.cpp \
$(XNL_ROOT)/src/event/IEventDispatcher.cpp \
$(XNL_ROOT)/src/event/EventDispatcher.cpp \
$(XNL_ROOT)/src/event/Event.cpp \
$(XNL_ROOT)/src/event/EventDispatcherManager.cpp

# define parameter
CCFLAGS += -Wno-sequence-point
CXXFLAGS += -Wno-sequence-point -std=c++0x

include xnl.mk

TARGET_DIR ?= $(XNL_ROOT)/lib/linux
TARGET := $(TARGET_DIR)/$(TARGET)

all: $(TARGET)

$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
	@mkdir -p $(@D)
	$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS)

$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
	@mkdir -p $(@D)
	$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
	@mkdir -p $(@D)
	$(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
